package com.zjtaixue.mybatis_learn.mapper;

import com.zjtaixue.mybatis_learn.model.SysRole;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface RoleMapper {

    @Select({"select id,role_name,enable,create_by,create_time,from sys_role,where id=#{id}"})
    SysRole selectById(Integer id);

    @Results({
            @Result(property = "id",column = "id",id=true),
            @Result(property = "roleName",column = "role_name"),
            @Result(property = "enable",column = "enable"),
            @Result(property = "createBy",column = "create_by"),
            @Result(property = "createTime",column = "create_time")
    })
    @Select("select id,role_name,enable,create_by,create_time from sys_role where id ={id}")
    SysRole selectById2(Integer id);
}
